﻿using System;
using System.Collections.Generic;
using WinRTFramework.FrameworkConfiguration;

namespace WinRTFramework.DefaultImplementations
{
    public class DefaultIoCAdapter : IIoCAdapter
    {
	    private readonly IEnumerable<Type> _allRegisteredTypes;

	    public DefaultIoCAdapter(IEnumerable<Type> allRegisteredTypes)
	    {
		    _allRegisteredTypes = allRegisteredTypes;
	    }

	    public DefaultIoCAdapter()
	    {
			_allRegisteredTypes = new Type[]{};
	    }

	    public virtual IEnumerable<Type> GetAllRegisteredTypes()
	    {
		    return _allRegisteredTypes;
	    }

        public virtual object GetInstanceOfType(Type t)
        {
            return Activator.CreateInstance(t);
        }
    }
}
